//
//  DetailViewModel.m
//  WebView
//
//  Created by 黄威 on 16/09/08
//  Copyright (c) JKLazyCat. All rights reserved.
//

#import "DetailViewModel.h"
#import "DetailViewPointComments.h"

@implementation DetailViewModel

-(void)setValue:(id)value forKey:(NSString *)key{
    
    [super setValue:value forKey:key];
 
    if ([key isEqualToString:@"id"]) {
        
        _uid = value;
        
    }
    if ([key isEqualToString:@"comments"]) {
        
         NSMutableArray *array = [NSMutableArray array];
        
        for (NSDictionary *dic in value) {
            
            
            DetailViewPointComments *detailComments = [DetailViewPointComments modelWithDic:dic];
            
            [array addObject:detailComments];

        }
        
        _comments = array;
        
    }
    
    
}

@end
